import request from "@/utils/request";

// 查询部门列表
export function listDept(query) {
  return request({
    url: "/system/dept/list",
    method: "get",
    params: query,
  });
}
// 查询部门列表
export function listTree(query) {
  return request({
    url: "/system/dept/listTree",
    method: "get",
    params: query,
  });
}

// 查询部门列表（排除节点）
export function listDeptExcludeChild(deptId) {
  return request({
    url: "/system/dept/list/exclude/" + deptId,
    method: "get",
  });
}

// 查询部门详细
export function getDept(deptId) {
  return request({
    url: "/system/dept/" + deptId,
    method: "get",
  });
}

// 查询当前登录人集团详细
export function getGroupInfo() {
  return request({
    url: "/system/dept/getGroupByUser",
    method: "get",
  });
}
// 查询部门下拉树结构
export function treeselect() {
  return request({
    url: "/system/dept/treeselect",
    method: "get",
  });
}

// 查询部门下拉树结构
export function userdepttree() {
  return request({
    url: "/system/dept/userdepttree",
    method: "get",
  });
}
// 根据角色ID查询部门树结构
export function roleDeptTreeselect(roleId) {
  return request({
    url: "/system/dept/roleDeptTreeselect/" + roleId,
    method: "get",
  });
}

// 新增部门
export function addDept(data) {
  return request({
    url: "/system/dept",
    method: "post",
    data: data,
  });
}

// 修改部门
export function updateDept(data) {
  return request({
    url: "/system/dept",
    method: "put",
    data: data,
  });
}

// 删除部门
export function delDept(deptId) {
  return request({
    url: "/system/dept/" + deptId,
    method: "delete",
  });
}

// 获取部门分账管理
export function setMnoSplit(deptId) {
  return request({
    url: "/system/dept/mnoSplit/" + deptId,
    method: "get",
  });
}

// 查询部门列表
export function getGroups() {
  return request({
    url: "/system/dept/groupList",
    method: "get",
  });
}

// 查询
export function getStations(query) {
  return request({
    url: "/system/dept/searchDeptList",
    method: "get",
    params: query,
  });
}

// 查询集团 和 站点的配置
export function selectDeptFlage(query) {
  return request({
    url: "/system/dept/selectDeptFlage",
    method: "get",
    params: query,
  });
}

// 根据油企账号获取所有油品
export function getListByEnterprise() {
  return request({
    url: "/oil/info/getListByEnterprise",
    method: "get",
  });
}

export function updateOilGunPrice(data) {
  return request({
    url: "/stationOillGun/info/updateOilGunPrice",
    method: "put",
    data: data,
  });
}

// GET /station/message/setShowPaymentCommission 设置是否展示支付页面渠道费1展示 0 不展示
export function setShowPaymentCommission(query) {
  return request({
    url: "/station/message/setShowPaymentCommission",
    method: "get",
    params: query,
  });
}


// 修改通道费状态
export function setShowCommissonApi(params){
  return request({
    url:'/station/message/setShowCommisson',
    method:'get',
    params:params
  })
}
// 按商户号查询
export function addMnoAllRateApi(params) {
  return request({
    url: "/payWay/info/setShowPayWayIds",
    method:'get',
    params:params
  });
}
